package com.baosight.sczx.common.zm.cInterface.cm;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;
import com.baosight.sczx.zm.cm.domain.ZMCMDepot;

/**
 * <p>Title: Material.java（库房信息）</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 李红星
 * @version 1.0
 * <pre>Histroy:
 *          2011-6-27 12:31:30  李红星  Create
 *</pre>
 */
public class Depot {
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
	
	/**
	 * 得到所有库房信息
	 * <p>Function: getDepotInfo</p>
	 * <p>Description: </p>
	 * <p>param IFUsing 使用状态</p>
	 * <p>return value:List<Map></p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-6-27 12:34:13 李红星 create
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List<Map> getDepotInfo(String IfUsing){
		List<Map> _list = new ArrayList<Map>();
		try {
			Map _argMap = new HashMap();
			_argMap.put("fdStatus", IfUsing);
			_list = dao.query("ZMCMDepot.inventory", _argMap);
		} catch (Exception e) {
			return _list;
		}
		return _list;
	}
	
	/**
	 * 获取一级库存信息
	 * <p>Function: getDepot</p>
	 * <p>Description: </p>
	 * <p>return value:List<Map></p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-7-14上午10:28:46 余虎
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List<Map> getDepot(String IfUsing){
		List<Map> _list = new ArrayList<Map>();
		try {
			Map _argMap = new HashMap();
			_argMap.put("fdDepotLevel", "一级");
			_list = dao.query("ZMCMDepot.queryForInterface", _argMap);
		} catch (Exception e) {
			return _list;
		}
		return _list;
	}
	
	/**
	 * 获取一级库存信息
	 * <p>Function: getDepots</p>
	 * <p>Description: </p>
	 * <p>return value:List<ZMCMDepot></p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-7-14下午05:36:36 张小飞
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List<ZMCMDepot> getDepots(){
		List<ZMCMDepot> _list = new ArrayList<ZMCMDepot>();
		try {
			Map map = new HashMap<String, String>();
			map.put("fdDepotLevel", "一级");
			_list = dao.query("ZMCMDepot.query", map);
		} catch (Exception e) {

		}
		return _list;
	}
}
